import {
  BaseEntity,
  Column,
  Entity,
  PrimaryColumn,
  PrimaryGeneratedColumn,
} from 'typeorm'

// 领用申请表
@Entity({ name: 'receive' })
export class Receive extends BaseEntity {
  // 自增主键
  @PrimaryGeneratedColumn({ type: 'int', name: 'id' })
  id: number

  // 领用编码
  @PrimaryColumn({
    type: 'varchar',
    name: 'receiveCode',
  })
  receiveCode: string

  // 申请人
  @Column({
    type: 'varchar',
    name: 'receivePerson',
  })
  receivePerson: string

  // 申请人id
  @Column({
    type: 'int',
    name: 'receivePersonId',
  })
  receivePersonId: number

  // 申请部门
  @Column({
    type: 'varchar',
    name: 'receiveBranch',
    nullable: true,
  })
  receiveBranch: string

  // 申请部门id
  @Column({
    type: 'int',
    name: 'receiveBranchId',
  })
  receiveBranchId: number

  // 申请日期
  @Column({
    type: 'varchar',
    name: 'receiveDate',
  })
  receiveDate: string

  // 领用人
  @Column({
    type: 'varchar',
    name: 'getPerson',
  })
  getPerson: string

  // 领用人Id
  @Column({
    type: 'int',
    name: 'getPersonId',
  })
  getPersonId: number

  // 领用部门
  @Column({
    type: 'varchar',
    name: 'getBranch',
  })
  getBranch: string

  // 领用部门id
  @Column({
    type: 'int',
    name: 'getBranchId',
  })
  getBranchId: number

  // 领用日期
  @Column({
    type: 'varchar',
    name: 'getDate',
    nullable: true,
  })
  getDate: string

  // 领用状态
  @Column({
    type: 'varchar',
    name: 'receiveType',
  })
  receiveType: string

  // 申请原因
  @Column({
    type: 'varchar',
    name: 'receiveReason',
    nullable: true,
  })
  receiveReason: string

  // 领用资产类型id
  @Column({
    type: 'int',
    name: 'typeId',
  })
  typeId: number

  // 领用资产编码
  @Column({
    type: 'varchar',
    name: 'assetCode',
    nullable: true,
  })
  assetCode: string

  // 备注
  @Column({
    type: 'varchar',
    name: 'remark',
    nullable: true,
  })
  remark: string

  // 批复
  @Column({
    type: 'varchar',
    name: 'reason',
    nullable: true,
  })
  reason: string

  // 是否删除
  @Column({
    type: 'tinyint',
    name: 'isDelete',
    nullable: true,
  })
  isDelete: boolean
}
